<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ include file="/views/commons/taglibs.jsp" %>
<script src="<%=path %>/js/common.js"></script>
<div class="panel-heading">
	<h3 class="panel-title">订单确认列表</h3>
</div>
<div class="bd clearfix">
	<form id="admin_trade_audit_choose_form" action="javascript:void(0);">
		<div class="filter-wrap">
			<dl class="clearfix invest-filter">
				<dt>订单号</dt>
				<dd class="clearfix">
					<div class="col-sm-8 mb20">
						<div class="input-group">
							<input type="text" name="tradeNo" value="${paramMap.tradeNo}" class="form-control" placeholder="订单号">
							<span class="input-group-btn">
								<button class="btn btn-primary" type="button" onclick="javascript:queryAdminTradeAuditList(1);">搜索</button>
							</span>
						</div>
					</div>
				</dd>
				
			</dl>
		</div>
		<div class="filter-wrap">
			<dl class="clearfix invest-filter">
				<dt>确认时间段</dt>
				<dd class="clearfix">
					<div class="col-sm-8 mb20">
						<div id="datepicker" class="input-daterange input-group">
							<input type="text" name="auditTimeStart" value='<fmt:formatDate value="${paramMap.auditTimeStart}" pattern='yyyy-MM-dd HH:mm:ss'/>' 
							class="form-control" placeholder="例：2016-08-09 15:21:10">
							<span class="input-group-addon">到</span>
							<input type="text" name="auditTimeEnd" value='<fmt:formatDate value="${paramMap.auditTimeEnd}" pattern='yyyy-MM-dd HH:mm:ss'/>' 
							class="form-control" placeholder="例：2016-08-09 15:21:15">
						</div>
					</div>
				</dd>
			</dl>
		</div>
		<d:radio describe="订单状态" tableColumn="trade_state" fieldName="tradeState" value="${paramMap.tradeState}" type="query_single" queryFunction="queryAdminTradeAuditList"/>
		
	</form>
</div>
<c:choose>
<c:when test="${!empty dataList && fn:length(dataList) ne 0}">
<table class="table">
	<thead>
		<tr>
			<th width="30%">商品名称</th>
			<th width="20%">确认时间</th>
			<th width="20%">状态</th>
			<th width="10%">订单数量</th>
			<th width="20%">操作</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach var="trade" items="${dataList}" varStatus="index">
		<tr>
			<td class="title">
				${trade.goods_name}
			</td>
			<td>${trade.audit_time}</td>
			<td>${trade.trade_state_name}</td>
			<td>${trade.trade_count}</td>
			<td>
				<c:if test="${trade.trade_state==2}">
				<a href="javascript:auditAndExport('${trade.goods_id}','${trade.trade_state}')">确认并导出</a>
				</c:if>
				<a href="<%=path %>/admin/trade/export?goodsId=${trade.goods_id}&tradeState=${trade.trade_state}&auditTime=${trade.audit_time}" target="_blank">订单导出</a>
			</td>
		</tr>
		</c:forEach>
	</tbody>
</table>
<!-- 分页 -->
<p:pagination pageNo="${paramMap.pageNo}" pageCount="${paramMap.pageCount}" queryFunction="queryAdminTradeAuditList" style="text-center"></p:pagination>
<!-- 分页 end -->
</c:when>
<c:otherwise>
	<table class="table">
		<thead>
			<tr>
				<th width="20%">商品名称</th>
				<th width="20%">确认时间</th>
				<th width="10%">状态</th>
				<th width="10%">订单数量</th>
				<th width="10%">操作</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td colspan="3" align="center">
					暂无数据
				</td>
			</tr>
		</tbody>
	</table>
</c:otherwise>
</c:choose>